home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrscript.win / feature files / vrhash.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.6 KB  |  190 lines

  1. //////////
  2. //
  3. //    File:        VRHash.h
  4. //
  5. //    Contains:    Header file for hash table management.
  6. //
  7. //    Written by:    Tim Monroe
  8. //
  9. //    Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //    Change History (most recent first):
  12. //
  13. //       <1>         11/28/98        rtm        first file (Happy Thanksgiving!)
  14. //       
  15. //////////
  16.  
  17. #pragma once
  18.  
  19. //////////
  20. //
  21. // header files
  22. //       
  23. //////////
  24.  
  25. #include "ComApplication.h"
  26. #include "VRScript.h"
  27.  
  28.  
  29. //////////
  30. //
  31. // constants
  32. //       
  33. //////////
  34.  
  35. // general parameters for our hash table
  36.  
  37. #define kNumEntriesInTable        127            // the number of bucket pointers in the hash table
  38.  
  39. // command codes for each supported command word
  40. enum {
  41.     kInvalidCommand = (UInt32)0,
  42.     kOpenQTVRMovieFile,
  43.     kReplaceMainMovie,
  44.     kSetCurrentDirectory,
  45.     kSetBarState,
  46.     kSetButtonState,
  47.     kSetResizeState,
  48.     kSetWindowSize,
  49.     kSetMaxWindowSize,
  50.     kReplaceCursor,
  51.     kSetHotSpotIDCursors,
  52.     kSetHotSpotTypeCursors,
  53.     kGoToNodeID,
  54.     kShowDefaultView,
  55.     kOpenResourceFile,
  56.     kSetCorrection,
  57.     kSetQuality,
  58.     kSetSwingSpeed,
  59.     kSetSwingDirection,
  60.     kSetSwingState,
  61.     kSetPanAngle,
  62.     kSetTiltAngle,
  63.     kSetPanTiltZoom,
  64.     kSetFieldOfView,
  65.     kSetViewCenter,
  66.     kSetPanLimits,
  67.     kSetTiltLimits,
  68.     kSetZoomLimits,
  69.     kSetHotSpotState,
  70.     kSetTranslateState,
  71.     kSetClickRadius,
  72.     kSetClickTimeout,
  73.     kSetPanTiltSpeed,
  74.     kSetZoomSpeed,
  75.     kSetMouseScale,
  76.     kSetFrameRate,
  77.     kSetViewRate,
  78.     kSetViewTime,
  79.     kSetViewState,
  80.     kSetAnimationState,
  81.     kSetControlState,
  82.     kSetFrameAnimState,
  83.     kSetViewAnimState,
  84.     kSetQTVRVisState,
  85.     kSetCachePrefs,
  86.     kSetMovieVolume,
  87.     kSetTrackVolume,
  88.     kSetSoundVolume,
  89.     kSetSoundBalance,
  90.     kPlaySceneSound,
  91.     kPlaySceneQTMidi,
  92.     kPlayNodeQTMidi,
  93.     kPlayNodeSound,
  94.     kPlayNode3DSound,
  95.     kHotSpotQTMidi,
  96.     kHotSpotSound,
  97.     kHotSpot3DSound,
  98.     kHotSpotMovie,
  99.     kTriggerHotSpot,
  100.     kPlayQTMidi,
  101.     kPlaySndResource,
  102.     kPlaySoundFile,
  103.     kPlay3DSndResource,
  104.     kPlay3DSndResourceAngle,
  105.     kShowPicture,
  106.     kShowNodePicture,
  107.     kAtTime,
  108.     kAtAppLaunch,
  109.     kAtAppQuit,
  110.     kAtMouseOverHSID,
  111.     kAtMouseOverHSType,
  112.     kAtClickHSID,
  113.     kAtClickHSType,
  114.     kAtClickCustomButton,
  115.     kAtClickSprite,
  116.     kAtNodeEntry,
  117.     kAtNodeExit,
  118.     kAtPanAngle,
  119.     kAtTiltAngle,
  120.     kAtZoomAngle,
  121.     kDoBoth,
  122.     kDoNothing,
  123.     kPlayMovie,
  124.     kPlayTransMovie,
  125.     kPlayTransEffect,
  126.     kMoveScreen,
  127.     kBeep,
  128.     kProcessScript,
  129.     kCreateBox,
  130.     kCreateCone,
  131.     kCreateCylinder,
  132.     kCreateEllipsoid,
  133.     kCreateTorus,
  134.     kCreateRectangle,
  135.     kOpen3DMFFile,
  136.     kSet3DObjLocation,
  137.     kSet3DObjColor,
  138.     kSet3DObjTransp,
  139.     kSet3DObjInterp,
  140.     kSet3DObjBackface,
  141.     kSet3DObjFill,
  142.     kSet3DObjRotation,
  143.     kSet3DObjRotState,
  144.     kSet3DObjVisState,
  145.     kSet3DObjTexture,
  146.     kDestroy3DObject,
  147.     kSet3DSndLocation,
  148.     kSetVariable,
  149.     kIf,
  150.     kSetSpriteVisState,
  151.     kSetSpriteLayer,
  152.     kSetSpriteGraphicsMode,
  153.     kSetSpriteImageIndex,
  154.     kSetSpriteMatrix,
  155.     kSetSpriteLocation,
  156.     kSetTrackState,
  157.     kSetTrackLayer,
  158.     kSetMovieTime,
  159.     kSetMovieRate,
  160.     kSetMovieTimeScale
  161. };
  162.  
  163.  
  164. //////////
  165. //
  166. // data types
  167. //       
  168. //////////
  169.  
  170. // a "bucket";
  171. // our hash table is an array of bucket pointers
  172. typedef struct VRScriptHash {
  173.     UInt32                        fCommandCode;        // the command code for the command word
  174.     char                        *fCommandWord;        // the command word
  175.     struct VRScriptHash            *fNextEntry;        // the next entry in the list
  176. } VRScriptHash, *VRScriptHashPtr;
  177.  
  178.  
  179. //////////
  180. //
  181. // function prototypes
  182. //       
  183. //////////
  184.  
  185. void                                VRHash_CreateHashTable (void);
  186. void                                VRHash_DestroyHashTable (void);
  187. UInt32                                VRHash_HashCommandWord (char *theCommandWord);
  188. void                                VRHash_PutCommandIntoTable (char *theCommandWord, UInt32 theCommandCode);
  189. UInt32                                VRHash_GetCommandCode (char *theCommandWord);
  190.